package lanou3g.com.Activity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

public class Splash_Activity extends Activity {


    private SharedPreferences preferences;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        preferences = getSharedPreferences("count", MODE_WORLD_READABLE);
        int count = preferences.getInt("count", 0);
        //判断程序与第几次运行，如果是第一次运行则跳转到引导页面
        if (count == 0) {
            Intent intent = new Intent();
            intent.setClass(getApplicationContext(), Welcome_Activity.class);
            startActivity(intent);
            this.finish();
            SharedPreferences.Editor editor = preferences.edit();
            //存入数据
            editor.putInt("count", ++count);
            //提交修改
            editor.commit();
        } else {
            Intent intent = new Intent();
            intent.setClass(Splash_Activity.this, Splash_one_Activity.class);
            startActivity(intent);
            overridePendingTransition(R.anim.sign_in, R.anim.start_animation);
            Splash_Activity.this.finish();

        }
    }
}